<div class="dashboard_style">
  <div class="graph_popup">
    <div class="dashboard_box small right">
      <h1>Invoices for <%= params[:chart_date]%></h1>
      <div class="grid_table current_invoices top">
        <table cellpadding="0" cellspacing="0" class="table table_listing invoice_listing">
          <colgroup>
            <col class="one"/>
            <col class="two"/>
            <col class="three"/>
            <col class="four"/>
            <col class="five"/>
          </colgroup>
          <th class="align_left">Invoice#</th>
          <th class="align_left">Client</th>
          <th class="align_left">Due date</th>
          <th class="align_left">Status</th>
          <th class="align_right">Amount</th>
        </table>
      </div>
      <!--grid_table-->
      <div class="scrollContainer content_scroll mCustomScrollbar">
        <div class="grid_table current_invoices btm mCustomScrollBox mCS-light">
          <table cellpadding="0" cellspacing="0" class="table table_listing invoice_listing mCSB_container">
            <colgroup>
              <col class="one"/>
              <col class="two"/>
              <col class="three"/>
              <col class="four"/>
              <col class="five"/>
            </colgroup>
            <tbody>
            <% @chart_details.each do |details| %>
                <tr>
                  <td class="align_left"><%= link_to details.invoice_number, invoice_path(details), target: '_blank' %></td>
                  <td class="align_left text-overflow-class"><%= details.client.organization_name rescue "" %></td>
                  <td class="align_left"><%= (details.due_date || details.invoice_date) rescue "" %></td>
                  <td class="align_left"><%= details.status %></td>
                  <td class="align_right"><%= number_to_currency(details.invoice_total, unit: details.currency.present? ? details.currency.unit : "$") %></td>
                </tr>
            <% end %>
            <tr>
              <td class="align_left"><b>Total</b></td>
              <td></td><td></td><td></td>
              <td class="align_right"><b><%= number_to_currency(@chart_total, unit: currency_is_off? ? "" : @chart_details.last.currency.try(:unit)) %></b></td>
            </tr>
            </tbody>
          </table>
        </div>
      </div>
      <!--grid_table-->
    </div>
  </div>
</div>